package kr.hkit.powerjava.chapter20;

import java.util.Calendar;
import java.util.Date;

public class DateEx {
	public static void main(String[] args) {
		//Date 예제 
		Date d = new Date(); 
		System.out.println(d); // 운영체제의 현제시간 나옴
		
		System.out.println("year: " + (1900+d.getYear())); //1900해줘야 2014나옴.
		System.out.println("month: " +(d.getMonth()+1));
		System.out.println("day: " + d.getDate());
		
		//캘린더 예제 494페이지
		Calendar cal = Calendar.getInstance();
		System.out.println(cal);
		System.out.println(cal.get(Calendar.YEAR) + "년");
		System.out.println(cal.get(Calendar.MONTH)+1 + "월");
		System.out.println(cal.get(Calendar.DATE) + "일");
		
	}
}
